#ifndef ENVELOPE_H
#define ENVELOPE_H

#include "stream.h"

#include <sys/types.h>

struct Envelope
{
	unsigned char content;
	u_int32_t size;
	unsigned char * data;
};

struct Envelope * createEnvelope(unsigned char content, size_t size, unsigned char * data);

void destroyEnvelope(struct Envelope * envelope);

void serializeEnvelope(struct Envelope * envelope, struct Stream * stream);

struct Envelope * deserializeEnvelope(struct Stream * stream);

void envelope_unit_test();

#endif
